using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Plant : TouchTriggerObject
{
    public bool HasGrown = false;
    public GameObject Platform;
    void Start()
    {
        PlayerFsm = GameObject.Find("Player").GetComponent<Player_FSM>();
        Platform.SetActive(false);
    }
    void Update()
    {
        if (HasGrown)
        {
            Platform.SetActive(true);
            return;
        }
        else if (HasTriggered)
        {
            if (IsStateFinished)
            {
                animator.Play("AfterGrow"); 
                HasGrown = true;
            }
        }
    }

    public override void TriggerEvent()
    {
        animator = GetComponent<Animator>();
        stateStartTime = Time.time;
        animator.Play("Grow");
    }
}
